package com.example.demo.entity;

import java.util.Date;

import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.ManyToOne;
import javax.persistence.Transient;

import org.springframework.format.annotation.DateTimeFormat;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnore;
/**
 * 二网公司二表
 * @author 吕佳辉
 *
 */
@Entity
public class TwoNetwork2  {
	
	private Integer id;
	private TwoNetwork twoNet;  //绑定二网公司名称
	
	private String area; //区域
	
	 
	private Date qianYueDate;//签约日期
	
	private Date jieYueDate; //解约日期
	 
	private Date beginDate;//开始修改时间
	private Date endDate;//结束时间

	@ManyToOne
	public TwoNetwork getTwoNet() {
		return twoNet;
	}
	public void setTwoNet(TwoNetwork twoNet) {
		this.twoNet = twoNet;
	}
	
	
	public String getArea() {
		return area;
	}
	public void setArea(String area) {
		this.area = area;
	}

	@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
	@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	public Date getQianYueDate() {
		return qianYueDate;
	}
	public void setQianYueDate(Date qianYueDate) {
		this.qianYueDate = qianYueDate;
	}
	
	@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
	@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	public Date getJieYueDate() {
		return jieYueDate;
	}
	public void setJieYueDate(Date jieYueDate) {
		this.jieYueDate = jieYueDate;
	}
	
	
	@Id
	@GeneratedValue
	@JsonIgnore
	public Integer getId() {
		return id;
	}
	public void setId(Integer id) {
		this.id = id;
	}
	
	@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
	@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	public Date getBeginDate() {
		return beginDate;
	}
	public void setBeginDate(Date beginDate) {
		this.beginDate = beginDate;
	}
	
	@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
	@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	public Date getEndDate() {
		return endDate;
	}
	public void setEndDate(Date endDate) {
		this.endDate = endDate;
	}
	
	@Transient
	public Integer getTwonetId() {
		return twoNet==null?null:twoNet.getId();
	}
	
	
	
}
